package org.now.ypos.user.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.now.ypos.user.dto.UserDto;
import org.now.ypos.user.entity.User;

import java.util.List;

/**
 * User Service
 *
 * @author wl
 * @since 2020.11.10
 */
public interface UserService {

    /**
     * save entity
     *
     * @param userDto userDto
     * @return rows
     */
    User save(UserDto userDto);

    /**
     * update entity
     *
     * @param userDto userDto
     * @return rows
     */
    User update(UserDto userDto);

    /**
     * get by id
     *
     * @param id id
     * @return entity
     */
    User getById(Long id);

    /**
     * delete by id
     *
     * @param id id
     * @return rows
     */
    int deleteById(Long id);

    /**
     * find by user
     *
     * @param userDto userDto
     * @return List<User> userList
     */
    List<User> find(UserDto userDto);

    /**
     * find by user page
     *
     * @param userDto userDto
     * @param page    page
     * @return IPage<User> pageUser
     */
    IPage<User> findPage(UserDto userDto, IPage<User> page);

}
